package com.ice.chatserver.dao;

import com.ice.chatserver.pojo.User;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;


/**
* @author ice2020x
* @Date: 2023/2/3
* @Description:  用户
**/
@Repository
public interface UserDao extends MongoRepository<User, String> {

    /**
     * 根据用户名或者code查询用户
     * @param username username
     * @param code code
     * @return User 用户信息
     */
    User findUserByUsernameOrCode(String username, String code);

    /**
     * 根据用户名查询用户
     * @param username username
     * @return User 用户信息
     */
    User findUserByUsername(String username);
}